# hardinfo
# Builds from https://github.com/puppylinux-woof-CE/petbuilds

. ../func
. ../build.conf

URL=http://distro.ibiblio.org/puppylinux/sources/h
PKG=hardinfo
VER=5.2-i18n
COMP=tar.bz2
DESC="System Profiler and Benchmark"
DEPS=+gtk+2
CAT=System
DESKTOP=hardinfo.desktop
BUILD=
CWD=$(pwd)
[ -z "$MWD" ] && MWD=$(dirname $CWD)	
[ -z "$BUILD" ] && BUILD=$DEF_BUILD
[ -f "$DESKTOP" ] || DESKTOP=not
[ -z "$DEPS" ] && DEPS=not	

ARCH=$(uname -m)
case $ARCH in
 *64) 	LIBDIR=$LIBCONF64 ;;
 arm*)	LIBDIR=$LIBCONFarm;;
 *) 	LIBDIR=$LIBCONF32 ;;
esac

build() {
	mkdir -p $CWD/${PKG}-install/usr/{bin,share}
	cd ${PKG}-${VER}
	mkdir build
	cd build
	cmake .. -DCMAKE_INSTALL_PREFIX=$CWD/${PKG}-install/usr
	make
	[ "$?" -eq 0 ] || exit
	make install 
	[ "$?" -eq 0 ] || exit
	cd ../../
}
	
# main
retrieve ${PKG}-${VER}.${COMP}
extract ${PKG}-${VER}.${COMP}
build
package_std $PKG $VER $ARCH $DESKTOP "$DESC" $DEPS $CAT	
